import { AdColumn } from '@/components/AdTable';
import { useI18n } from '@/hooks/web/useI18n';

const { t } = useI18n();

export const columns: AdColumn[] = [
  {
    title: t('entity.idTitle'),
    dataIndex: 'Id',
    width: 180,
    ifShow: false,
    defaultHidden: true,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('report.route.report.kanban.nameTitle'),
    dataIndex: 'Name',
    width: 200,
    formVisible: true,
    formEditable: true,
    required: true,
    filterable: true,
    dataType: 'string',
    sorter: { multiple: 1 },
  },
  {
    title: t('report.route.report.kanban.thumbnailTitle'),
    dataIndex: 'Thumbnail',
    width: 70,
    formVisible: false,
    formEditable: false,
    required: false,
    filterable: false,
    dataType: 'string',
  },
  {
    title: t('report.route.report.kanban.remarksTitle'),
    dataIndex: 'Remarks',
    width: 200,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'text',
    formCustomer: {
      colProps: {
        // span: 24,
        xs: 24, // <576px
        sm: 24, // ≥576px
        md: 24, // ≥768px
        lg: 24, // ≥992px
        xl: 24, // ≥1200px
        xxl: 24, // ≥1600px
        // xxxl: 24, // ≥2000px 3.0
      },
    },
  },
  {
    title: t('report.route.report.kanban.releasedTitle'),
    dataIndex: 'Released',
    width: 80,
    formVisible: true,
    formEditable: true,
    filterable: true,
    dataType: 'boolean',
    sorter: { multiple: 2 },
    formCustomer: {
      colProps: {
        // span: 8,
        xs: 24, // <576px
        sm: 24, // ≥576px
        md: 12, // ≥768px
        lg: 12, // ≥992px
        xl: 8, // ≥1200px
        xxl: 8, // ≥1600px
        // xxxl: 8, // ≥2000px 3.0
      },
    },
  },
  {
    title: t('report.route.report.kanban.contentTitle'),
    dataIndex: 'Content',
    width: 0,
    ifShow: false,
    defaultHidden: true,
    formVisible: false,
    formEditable: false,
    filterable: false,
    dataType: 'text',
  },
  {
    title: t('entity.creationAudited.creatorIdTitle'),
    dataIndex: 'CreatorId',
    width: 0,
    ifShow: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('entity.creationAudited.creatorNameTitle'),
    dataIndex: 'CreatorName',
    width: 100,
    filterable: true,
    formVisible: true,
    formEditable: false,
    filterIndex: 'CreatorId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'UserName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.creationAudited.creatorNicknameTitle'),
    dataIndex: 'CreatorNickname',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'CreatorId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'NickName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.creationAudited.createdTimeTitle'),
    dataIndex: 'CreatedTime',
    width: 180,
    edit: false,
    editRow: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
    sorter: { multiple: 5 },
  },
  {
    title: t('entity.updateAudited.updaterIdTitle'),
    dataIndex: 'UpdaterId',
    width: 0,
    ifShow: false,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'integer',
  },
  {
    title: t('entity.updateAudited.updaterNameTitle'),
    dataIndex: 'UpdaterName',
    width: 100,
    filterable: true,
    formVisible: true,
    formEditable: false,
    filterIndex: 'UpdaterId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'UserName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.updateAudited.updaterNicknameTitle'),
    dataIndex: 'UpdaterNickname',
    width: 100,
    formVisible: true,
    formEditable: false,
    filterable: true,
    filterIndex: 'UpdaterId',
    filterJoin: {
      entityType: 'EaCloud.Pack.Identity.Entities.User,EaCloud.Pack.Identity',
      filterField: 'NickName',
      selectField: 'Id',
    },
    dataType: 'string',
  },
  {
    title: t('entity.updateAudited.updatedTimeTitle'),
    dataIndex: 'UpdatedTime',
    width: 180,
    formVisible: true,
    formEditable: false,
    filterable: true,
    dataType: 'datetime',
    sorter: { multiple: 6 },
  },
];
